package com.hgy.service.impl;

import com.hgy.dao.CityDao;
import com.hgy.entity.City;
import com.hgy.service.CityService;
import com.hgy.vo.VCity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author : ang
 * @Program: carSystem
 * @Title : CityServiceImpl
 * @Date : 2020-08-27 14:35
 **/
@Service
public class CityServiceImpl implements CityService {

    @Autowired
    private CityDao cityDao;

    @Override
    public List<City> findCity(Integer pid) {
        List<City> list = cityDao.findCity(pid);
        return list;
    }

    @Override
    public VCity findById(Integer getid, Integer backid) {
        City getCity = cityDao.findById(getid);
        City backCity = cityDao.findById(backid);

        VCity vCity = new VCity();
        vCity.setGetCity(getCity);
        vCity.setBackCity(backCity);
        return vCity;
    }
}